package com.hsbc.dev.teamo4.sms.sm.po;

import com.hsbc.dev.teamo4.sms.common.base.EntityBean;
import org.hibernate.validator.constraints.NotBlank;

import javax.validation.constraints.NotNull;

/**
 * @author:Kevin
 * @version:
 * @Project: permission_manage
 * @Package: com.hsbc.dev.teamo4.sms.sm.po
 * @Description:
 * @Date date: 2018/7/26
 */
public class Permission extends EntityBean {
    @NotNull(message = "id can't null")
    private String id;
    @NotBlank(message = "permissionName can't is a empty")
    private String permissionName;
    @NotBlank(message = "menuId can't is a empty")
    private String menuId;
    @NotBlank(message = "permissionCode can't is a empty")
    private String permissionCode;
    private int permissionOrder;
    private String permissionHref;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getPermissionName() {
        return permissionName;
    }

    public void setPermissionName(String permissionName) {
        this.permissionName = permissionName;
    }

    public String getMenuId() {
        return menuId;
    }

    public void setMenuId(String menuId) {
        this.menuId = menuId;
    }

    public String getPermissionHref() {
        return permissionHref;
    }

    public void setPermissionHref(String permissionHref) {
        this.permissionHref = permissionHref;
    }

    public String getPermissionCode() {
        return permissionCode;
    }

    public void setPermissionCode(String permissionCode) {
        this.permissionCode = permissionCode;
    }

    public int getPermissionOrder() {
        return permissionOrder;
    }

    public void setPermissionOrder(int permissionOrder) {
        this.permissionOrder = permissionOrder;
    }

    @Override
    public String toString() {
        return "Permission{" +
                "id='" + id + '\'' +
                ", permissionName='" + permissionName + '\'' +
                ", menuId='" + menuId + '\'' +
                ", permissionCode='" + permissionCode + '\'' +
                ", permissionOrder=" + permissionOrder +
                ", permissionHref='" + permissionHref + '\'' +
                super.toString()+ '\'' +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        if (!super.equals(o)) {
            return false;
        }

        Permission that = (Permission) o;

        return id.equals(that.id);
    }

    @Override
    public int hashCode() {
        int result = super.hashCode();
        result = 31 * result + id.hashCode();
        return result;
    }
}
